/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.agi.devsol.aplicacao;

import javax.annotation.PostConstruct;
import javax.enterprise.context.RequestScoped;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.inject.Named;



/**
 *
 * @author rgrosz
 */
@RequestScoped
@Named
public class AppMain {
    private String appName;
    private String contextPath;
    
    public  AppMain(){
        this.appName = "DevSol";
        this.contextPath = "" ;
    }
    
    @PostConstruct
    public void init(){
        this.contextPath = this.getCurrentPath();        
    }

    private String getCurrentPath(){        
        FacesContext ctx = FacesContext.getCurrentInstance();
        ExternalContext eCtx = ctx.getExternalContext();        
        String path = eCtx.getRequestContextPath() +  "/faces";
        return path;
    }

    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public String getContextPath() {
        return contextPath;
    }

    public void setContextPath(String contextPath) {
        this.contextPath = contextPath;
    }
    
    
}
